#-------------------------------------------------------------------------------
# Name:        模块1
# Purpose: 输入某年某月判断这是一年的第几天
#
# Author:      LENOVO
#
# Created:     06/11/2024
# Copyright:   (c) LENOVO 2024
# Licence:     <your licence>
#-------------------------------------------------------------------------------
import datetime

def is_leap_year(year):
    """判断是否是闰年"""
    return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)

def days_in_month(year, month):
    """返回指定月份的天数"""
    if month == 2:
        return 29 if is_leap_year(year) else 28
    elif month in [4,6,9,11]:
        return 30
    else:
        return 31
    pass
def main():
    year = int(input("请输入年份"))
    month = int(input("请输入月份"))
    day = int(input("请输入日子"))
    totalDays = sum(days_in_month(year,m) for m in range(1,month))

    totalDays = totalDays + day
    print(f"{year}年{month}月{day}日是这一年的第{totalDays}天")
    pass

if __name__ == '__main__':
    main()
